<template>
	<view style="padding-bottom: 50rpx;">
		<page-head :title="'评价'" :headtype="2"></page-head>
		<view class="evlist">
			<view class="evitem flex marginAuto" v-for="(item,index) in datas" :key="index">
				<view class="evitemtime">{{ item.create_time }}</view>
				<view class="evitemimg">
					<image :src="apifun.URLimg+item.user_avatar" mode=""></image>
				</view>
				<view class="evitemmsg">
					<view class="evitemmsgname ellipsis01" style="width:50%;" v-if="item.anonymity == 1">匿名</view>
					<view class="evitemmsgname ellipsis01" style="width:50%;" v-if="item.anonymity == 0">{{ item.user_name }}</view>
					<view class="evitemmsgxing flex">
						<uv-icon class="gradetxtxingeach" :name="item.score >= 1 ? 'star-fill':'star'" size="18" color="#EB6302"></uv-icon>
						<uv-icon class="gradetxtxingeach" :name="item.score >= 2 ? 'star-fill':'star'" size="18" color="#EB6302"></uv-icon>
						<uv-icon class="gradetxtxingeach" :name="item.score >= 3 ? 'star-fill':'star'" size="18" color="#EB6302"></uv-icon>
						<uv-icon class="gradetxtxingeach" :name="item.score >= 4 ? 'star-fill':'star'" size="18" color="#EB6302"></uv-icon>
						<uv-icon class="gradetxtxingeach" :name="item.score >= 5 ? 'star-fill':'star'" size="18" color="#EB6302"></uv-icon>
					</view>
					<view class="evitemmsgtxt">{{ item.content }}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				apifun:this.apifun,
				jlid:'',
				datas:[]
			};
		},
		onLoad(option) {
			this.jlid = option.jlid;
			this.initData();
		},
		methods: {
			initData(){
				let sendData= {
					id:this.jlid
				};
				this.apifun.unirequest('/api/partnerDrive/getPartnerEvaList','post',sendData,(res)=>{
					if(res.code === 200){
						let datas = res.data;
						if(datas.data.length <= 0){
							this.page--;
							return false
						};
						this.datas = [...this.datas,...datas.data];
					}else{
						this.apifun.toast(res.msg)
					}
				})
			}
		},
		onPullDownRefresh() {
			this.page = 1;
			this.datas = [];
			this.initData();
			uni.stopPullDownRefresh();
		},
		onReachBottom() {
			this.page++;
			this.initData()
		},
	};
</script>

<style scoped lang="scss">
	.evlist{
		.evitem{
			position: relative;
			width: 650rpx;
			padding: 20rpx;
			background: #fff;
			border-radius: 20rpx;
			margin-top: 20rpx;
			.evitemtime{
				position: absolute;
				right:20rpx;
				top:20rpx;
				color:#999999;
				font-size: 24rpx;
			}
			.evitemimg{
				width: 80rpx;
				height: 80rpx;
				image{
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
				}
			}
			.evitemmsg{
				width: 85%;
				margin-left: 20rpx;
				.evitemmsgname{
					color: #222222;
					font-size: 34rpx;
					line-height:50rpx;
					font-weight: 600;
				}
				.evitemmsgxing{
					padding: 4rpx 0 10rpx;
				}
				.evitemmsgtxt{
					line-height: 50rpx;
					font-size: 30rpx;
					color: #333333;
				}
			}
		}
	}
</style>